import request from '@/utils/request'
import {praseStrEmpty} from "../../../utils/project";

// 查询园区门禁信息列表
export function listGuard(query) {
    return request({
        url: '/server/guard/list',
        method: 'get',
        params: query
    })
}

// 查询园区门禁信息详细
export function getGuard(guardId) {
    return request({
        url: '/server/guard/' + guardId,
        method: 'get'
    })
}
// 查询通过园区门禁用户信息详细
export function getFace(userId) {
  return request({
    url: '/system/user/' + praseStrEmpty(userId),
    method: 'get'
  })
}

// 新增园区门禁信息
export function addGuard(data) {
    return request({
        url: '/server/guard',
        method: 'post',
        data: data
    })
}

// 修改园区门禁信息
export function updateGuard(data) {
    return request({
        url: '/server/guard',
        method: 'put',
        data: data
    })
}

// 删除园区门禁信息
export function delGuard(guardId) {
    return request({
        url: '/server/guard/' + guardId,
        method: 'delete'
    })
}

// 导出园区门禁信息
export function exportGuard(query) {
    return request({
        url: '/server/guard/export',
        method: 'get',
        params: query
    })
}
